package com.kj.xuyuan.adapter;

import android.view.View;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.kj.xuyuan.R;

public class UniversalPopAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    private int count;

    public UniversalPopAdapter() {
        super(R.layout.item_universal);
    }

    public void setCount(int count){
        this.count = count;
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        helper.setText(R.id.tv_content,item);
        TextView line = helper.getView(R.id.tv_line);
        if(helper.getLayoutPosition() == count-1){
            line.setVisibility(View.INVISIBLE);
        }else{
            line.setVisibility(View.VISIBLE);
        }
    }
}
